package com.dwj.auto.comment.controller;


import com.dwj.auto.comment.common.response.PageResponse;
import com.dwj.auto.comment.common.response.Response;
import com.dwj.auto.comment.model.form.ExamForm;
import com.dwj.auto.comment.model.req.ExamCriteria;
import com.dwj.auto.comment.model.req.ExamSearchCriteria;
import com.dwj.auto.comment.model.vo.ExamSearchVo;
import com.dwj.auto.comment.model.vo.ExamVo;
import com.dwj.auto.comment.service.IExamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author dwjian
 * @since 2020-01-21
 */
@RestController
@RequestMapping("/api/exam")
public class ExamController {

    @Autowired
    private IExamService examService;

    @GetMapping("/get/list")
    public PageResponse<ExamVo> getList(ExamCriteria pagination){
        return examService.getList(pagination);
    }

    @PostMapping("/edit")
    public Response<String> edit(@RequestBody ExamForm form){
        return examService.edit(form);
    }

    @GetMapping("/search/list")
    public PageResponse<ExamSearchVo> searchList(ExamSearchCriteria pagination){
        return examService.searchList(pagination);
    }
}
